#!/usr/bin/env python
# encoding: utf-8

from bookspider import BookSpider

class mySpider(BookSpider):
  def prepare(self):
      '准备工作实现'

  def book_name(self):
    return 'BookName'

  def sections(self):
    return [
        'http://www.baidu.com/'
        # ... ...
    ]

  def process_page(self, pos, url, page):
    # using etree or other, parse page and response dict like this.
    return {
      'title': 'BookTitle',
      'body': b'Page Content',
    }


def main():
  b = mySpider()
  b.crawl()
  b.make_epub()


if __name__ == '__main__':
  main()
